<?php
namespace app\api\validate;

use think\Validate;

class User extends Validate
{
    protected $rule = [
        'username'  =>  'require|length:4,12',
        'password' =>  'require|min:6',
        'email' => 'email'
    ];

    protected $message  =   [
        'username.require' => '用户名不能为空',
        'username.length'     => '用户名需要在4-12位之间',
        'password.require'   => '密码不能为空',
        'password.min'  => '密码需要大于6位',
        'email'        => '邮箱格式错误',    
    ];
}